\documentclass{article}
\usepackage[usenames]{color}
\usepackage{gastex}
\usepackage[papersize={9cm,7cm},left=0cm,right=0cm,top=0cm,bottom=0cm,bindingoffset=0cm]{geometry}

\begin{document}

% Loop width and height

\begin{center}
  \begin{picture}(20,40)(25,20)\compatiblegastexun
%     \put(-7,-11){\framebox(118,28){}}
%    \gasset{Nw=5,Nh=5,fillgray=1}
    \gasset{Nw=10,Nh=10,fillgray=1,Nmr=0,linewidth=0.5}
%  \node[Nw=15,Nh=6,Nmr=0](A)(25,0){rectangle}
\huge{

    \node(A_1)(0,0){a}
    \node(A_2)(10,0){a}
    \node(A_3)(20,0){b}
    \node(A_4)(30,0){c}
    \node(A_5)(40,0){b}
    \node(A_6)(50,0){a}

    \node[Nmr=3](C)(47,15){=2}

    \node(B_1)(0,30){a}
    \node(B_2)(10,30){c}
    \node(B_3)(20,30){b}
    \node(B_4)(30,30){c}
    \node(B_5)(40,30){a}
    \node(B_6)(50,30){a}

    }

\gasset{linecolor=Red}
    \drawundirectededge(B_2,A_2){}
    \drawundirectededge(B_5,A_5){}

  \end{picture}
\end{center}
 \end{document}


